//===================================================================
// SOP for 4mosa flash update
// How to parpare your environment
//===================================================================
1. connect UART(RS232) by NULL-MODEM cable between PC & DVR.
2. launch "Hyper Terminal" program on XP.
3. power on DVR.
4. when console display "Hit any key to stop autoboot:", please press "=" key.
5. "==>" will be showed on "Hyper Terminal".
6. type "set ipaddr 192.168.16.200", <--- this is IP of your DVR.
7. type "set serverip 192.168.16.201" <--- this is IP of your TFTP Server.
8. type "protect off all".


//===================================================================
// how to update uboot
//===================================================================
9.if you want to update "uboot"
9.1.please copy "u-boot.4mosa" to your TFTP server.
9.2.type "tftp e4000000 u-boot.4mosa"
9.3.type "erase 34000000 +20000"
9.4.type "cp.b e4000000 34000000 20000"


//===================================================================
// how to update Linux Kernel
//===================================================================
10.if you want to update "Linux Kernel"
10.1.please copy "uImage.4mosa" to your TFTP server.
10.2.type "tftp e4000000 uImage.4mosa"
10.3.type "erase 34080000 +180000"
10.4.type "cp.b e4000000 34080000 180000"


//===================================================================
// how to reboot DVR
//===================================================================
11.When above steps are completed, reboot your DVR.
method 1: type "reset"
method 2: power off DVR, then power on DVR again.


//===================================================================
// PIN definition of UART interface
//===================================================================
PIN1 : 3.3V
PIN2 : Ground
PIN3 : Tx (3.3V)
PIN4 : Rx (3.3V)
PIN5 : Non used
PIN6 : Non used


//===================================================================
// u-boot
//===================================================================
build procedure :
make distclean
make hiconfig
select 1
make

install procedure :
see section 9


//===================================================================
// linux kernel
//===================================================================
make clean
make

install procedure :
see section 10


//===================================================================
// cdrtools
//===================================================================
build procedure :
sh hi3515.sh
tar -xvf armtools.tar.gz
tar -xvf cdrtools-2.01.01-hisi.tar.gz
cd cdrtools-2.01.01-hisi
cd cdrecord-magic-p2
make clean
make

install procedure :
use TFTP tool to download "cdburner" to "/".


//===================================================================
// dosfstools
//===================================================================
build procedure :
tar xvf dosfstools-3.0.6.tar.gz 
cd dosfstools-3.0.6/
make mkdosfs

install procedure :
use TFTP tool to download "mkdosfs" to "/usr/local/4mosa_bin".


//===================================================================
// fdisk
//===================================================================
build procedure :
tar xvf util-linux-ng-2.16.1.tar.gz 
cd util-linux-ng-2.16.1/fdisk/
make

install procedure :
use TFTP tool to download "fdisk" to "/usr/local/4mosa_bin".


//===================================================================
// openssl
//===================================================================
build procedure :
tar xvf openssl-0.9.8i.tar.gz
cd openssl-0.9.8i
make

install procedure :

//===================================================================
// nbsmtp
//===================================================================
build procedure :
tar xvf nbsmtp-1.01-cvs.tar.gz 
cd nbsmtp-1.01-cvs/
make

install procedure :
use TFTP tool to download "nbsmtp" to "/usr/sbin".


//===================================================================
// smartmontools (smart_hd.arm)
//===================================================================
build procedure :
arm-hisi-linux-gcc -c -g -Wall -I./include smart_hd.c -o smart_hd.arm

install procedure :
use TFTP tool to download "smart_hd.arm" to "/usr/bin".


//===================================================================
// smartmontools (smartctl)
//===================================================================
build procedure :
tar xvf smartmontools-5.39.tar.gz 
cd smartmontools-5.39/
./configure --host=arm-hisi-linux
make smartctl

install procedure :
use TFTP tool to download "smartctl" to "/usr/bin".


//===================================================================
// findutils
//===================================================================
build procedure :
tar xvf findutils-4.2.29.tar.gz 
cd findutils-4.2.29/
make

install procedure :
use TFTP tool to download "find" & "xargs" to "/usr/bin".


//===================================================================
// busybox
//===================================================================
build procedure :
tar xvf busybox-1.1.2.tar.gz 
cd busybox-1.1.2/
make all

install procedure :
1.command "cd ~".
2.use TFTP tool to download "busybox" to "/".
3.command "mv busybox busybox.new".
4.command "chmod +x busybox.new".
5.command "cd /bin"
6.command "cp busybox busybox.bak"
7.command "cp -f ../busybox.new busybox".

//===================================================================
// cross-compiler
//===================================================================
build and install procedure :
tar jxvf cross-gcc-3.4.3-uClibc-0.9.28.src_.tar.bz2
cd corss-arm-linux-uclibc
./arm-linux-uclibc

//===================================================================
//libxyssl.so
//===================================================================
build procedure :
tar xvf xyssl.tar.gz
cd /xyssl/src
make clean 
make 

install procedure :
cd /xyssl/src 
copy the libxyssl.so to the bahu's /lib

